

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>指标 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="实验性功能" href="../experimental-features/" />
    <link rel="prev" title="Mantle" href="../mantle/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../">Ceph 文件系统</a></li>
      <li class="breadcrumb-item active">指标</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../_sources/cephfs/metrics.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 文件系统</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../#cephfs">CephFS 入门</a></li>
<li class="toctree-l2"><a class="reference internal" href="../#id4">管理</a></li>
<li class="toctree-l2"><a class="reference internal" href="../#id5">挂载 CephFS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../#id6">CephFS 内幕</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../#id7">故障排除和灾难恢复</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../eviction/"> 驱逐客户端</a></li>
<li class="toctree-l3"><a class="reference internal" href="../scrub/"> 洗刷</a></li>
<li class="toctree-l3"><a class="reference internal" href="../full/"> 文件系统占满的处理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../disaster-recovery-experts/"> 元数据修复</a></li>
<li class="toctree-l3"><a class="reference internal" href="../troubleshooting/"> 故障排除</a></li>
<li class="toctree-l3"><a class="reference internal" href="../disaster-recovery/"> 灾难恢复</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cephfs-journal-tool/"> cephfs-journal-tool</a></li>
<li class="toctree-l3"><a class="reference internal" href="../recover-fs-after-mon-store-loss/"> 监视器存储丢失后恢复文件系统</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="../#id8">开发者指南</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="../journaler/"> Journaler 配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="../capabilities/"> 客户端的能力</a></li>
<li class="toctree-l4"><a class="reference internal" href="../api/"> Java 和 Python 捆绑库</a></li>
<li class="toctree-l4"><a class="reference internal" href="../mantle/"> Mantle</a></li>
<li class="toctree-l4 current"><a class="current reference internal" href="#">指标</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">查看指标</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../#id9">更多细节</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="cephfs-metrics">
<span id="id1"></span><h1>指标<a class="headerlink" href="#cephfs-metrics" title="Permalink to this heading"></a></h1>
<p>CephFS 使用 <a class="reference internal" href="../../dev/perf_counters/#perf-counters"><span class="std std-ref">性能计数器</span></a>跟踪指标。可以给这些计数器打标签（ <a class="reference internal" href="../../dev/perf_counters/#labeled-perf-counters"><span class="std std-ref">带标签的性能计数器</span></a> ）。</p>
<section id="id2">
<h2>客户端指标<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p>CephFS 把客户端指标导出为 <a class="reference internal" href="../../dev/perf_counters/#labeled-perf-counters"><span class="std std-ref">带标签的性能计数器</span></a>，可用于监控性能。 CephFS 输出以下客户端指标。</p>
<table class="docutils align-default" id="id4">
<caption><span class="caption-text">客户端指标</span><a class="headerlink" href="#id4" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 20.0%" />
<col style="width: 20.0%" />
<col style="width: 60.0%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Name</p></th>
<th class="head"><p>Type</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>num_clients</p></td>
<td><p>Gauge</p></td>
<td><p>客户端会话数量</p></td>
</tr>
<tr class="row-odd"><td><p>cap_hits</p></td>
<td><p>Gauge</p></td>
<td><p>文件具有的能力占所有能力总数的百分比</p></td>
</tr>
<tr class="row-even"><td><p>cap_miss</p></td>
<td><p>Gauge</p></td>
<td><p>文件不具有的能力占所有能力总数的百分比</p></td>
</tr>
<tr class="row-odd"><td><p>avg_read_latency</p></td>
<td><p>Gauge</p></td>
<td><p>读延时平均值</p></td>
</tr>
<tr class="row-even"><td><p>avg_write_latency</p></td>
<td><p>Gauge</p></td>
<td><p>写延时平均值</p></td>
</tr>
<tr class="row-odd"><td><p>avg_metadata_latency</p></td>
<td><p>Gauge</p></td>
<td><p>元数据延时平均值</p></td>
</tr>
<tr class="row-even"><td><p>dentry_lease_hits</p></td>
<td><p>Gauge</p></td>
<td><p>发放的 dentry 租约申请占 dentry 租约请求总量的百分比</p></td>
</tr>
<tr class="row-odd"><td><p>dentry_lease_miss</p></td>
<td><p>Gauge</p></td>
<td><p>发放的 dentry 租约失败占 dentry 租约请求总量的百分比</p></td>
</tr>
<tr class="row-even"><td><p>opened_files</p></td>
<td><p>Gauge</p></td>
<td><p>已打开文件的数量</p></td>
</tr>
<tr class="row-odd"><td><p>opened_inodes</p></td>
<td><p>Gauge</p></td>
<td><p>已打开 inode 的数量</p></td>
</tr>
<tr class="row-even"><td><p>pinned_icaps</p></td>
<td><p>Gauge</p></td>
<td><p>锁定的 Inode Caps 数量</p></td>
</tr>
<tr class="row-odd"><td><p>total_inodes</p></td>
<td><p>Gauge</p></td>
<td><p>Inodes 总数</p></td>
</tr>
<tr class="row-even"><td><p>total_read_ops</p></td>
<td><p>Gauge</p></td>
<td><p>所有进程产生的读出操作总数</p></td>
</tr>
<tr class="row-odd"><td><p>total_read_size</p></td>
<td><p>Gauge</p></td>
<td><p>所有进程产生的输入、输出操作中，读取的字节数</p></td>
</tr>
<tr class="row-even"><td><p>total_write_ops</p></td>
<td><p>Gauge</p></td>
<td><p>所有进程产生的写入操作总数</p></td>
</tr>
<tr class="row-odd"><td><p>total_write_size</p></td>
<td><p>Gauge</p></td>
<td><p>所有进程产生的输入、输出操作中，写入的字节数</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id3">
<h1>查看指标<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h1>
<p>这些指标可以从 MDS 管理套接字中获取，也可以用 tell 接口获取。 <code class="docutils literal notranslate"><span class="pre">counter</span> <span class="pre">dump</span></code> 命令输出中的 <code class="docutils literal notranslate"><span class="pre">mds_client_metrics-&lt;fsname&gt;</span></code> 部分显示了每个客户端的指标，如下所示：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;mds_client_metrics&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">&quot;labels&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;fs_name&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;fsname&gt;&quot;</span><span class="p">,</span>
            <span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;14213&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;counters&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;num_clients&quot;</span><span class="p">:</span> <span class="mi">2</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;mds_client_metrics-&lt;fsname&gt;&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">&quot;labels&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;client&quot;</span><span class="p">:</span> <span class="s2">&quot;client.0&quot;</span><span class="p">,</span>
            <span class="s2">&quot;rank&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;counters&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;cap_hits&quot;</span><span class="p">:</span> <span class="mi">5149</span><span class="p">,</span>
            <span class="s2">&quot;cap_miss&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">&quot;avg_read_latency&quot;</span><span class="p">:</span> <span class="mf">0.000000000</span><span class="p">,</span>
            <span class="s2">&quot;avg_write_latency&quot;</span><span class="p">:</span> <span class="mf">0.000000000</span><span class="p">,</span>
            <span class="s2">&quot;avg_metadata_latency&quot;</span><span class="p">:</span> <span class="mf">0.000000000</span><span class="p">,</span>
            <span class="s2">&quot;dentry_lease_hits&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;dentry_lease_miss&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;opened_files&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">&quot;opened_inodes&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;pinned_icaps&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;total_inodes&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;total_read_ops&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;total_read_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;total_write_ops&quot;</span><span class="p">:</span> <span class="mi">4836</span><span class="p">,</span>
            <span class="s2">&quot;total_write_size&quot;</span><span class="p">:</span> <span class="mi">633864192</span>
        <span class="p">}</span>
    <span class="p">},</span>
    <span class="p">{</span>
        <span class="s2">&quot;labels&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;client&quot;</span><span class="p">:</span> <span class="s2">&quot;client.1&quot;</span><span class="p">,</span>
            <span class="s2">&quot;rank&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;counters&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;cap_hits&quot;</span><span class="p">:</span> <span class="mi">3375</span><span class="p">,</span>
            <span class="s2">&quot;cap_miss&quot;</span><span class="p">:</span> <span class="mi">8</span><span class="p">,</span>
            <span class="s2">&quot;avg_read_latency&quot;</span><span class="p">:</span> <span class="mf">0.000000000</span><span class="p">,</span>
            <span class="s2">&quot;avg_write_latency&quot;</span><span class="p">:</span> <span class="mf">0.000000000</span><span class="p">,</span>
            <span class="s2">&quot;avg_metadata_latency&quot;</span><span class="p">:</span> <span class="mf">0.000000000</span><span class="p">,</span>
            <span class="s2">&quot;dentry_lease_hits&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;dentry_lease_miss&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;opened_files&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">&quot;opened_inodes&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;pinned_icaps&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;total_inodes&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;total_read_ops&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;total_read_size&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;total_write_ops&quot;</span><span class="p">:</span> <span class="mi">3169</span><span class="p">,</span>
            <span class="s2">&quot;total_write_size&quot;</span><span class="p">:</span> <span class="mi">415367168</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">]</span>
</pre></div>
</div>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../mantle/" class="btn btn-neutral float-left" title="Mantle" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../experimental-features/" class="btn btn-neutral float-right" title="实验性功能" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>